import 'babel-polyfill'
import 'classlist-polyfill'
import Vue from 'vue'
import axios from './router/axios'
import VueAxios from 'vue-axios'
import App from './App'
import './permission' // 权限
import './error' // 日志
import './cache'//页面缓冲
import router from './router/router'
import store from './store'
import { loadStyle } from './util/util'
import * as urls from '@/config/env'
import { iconfontUrl, iconfontVersion } from '@/config/env'
import tableHeight from '@/util/tableHeight'
import * as filters from './filters' // 全局filter
import AvueUeditor from "avue-plugin-ueditor";
import ElementUI from 'element-ui'
import Antd  from 'ant-design-vue';
import 'element-ui/lib/theme-chalk/index.css'
import './styles/common.scss'
// import AvueFormDesign from '@sscfaith/avue-form-design'
import tableDesign from "@/components/table-design/index.js";
import basicContainer from './components/basic-container/main'
import 'ant-design-vue/dist/antd.css';
import '@/components/table-design/styles/index.scss'
import moment from'moment'
import dayjs from 'dayjs'
import Print from '@/components/vue-print-nb-master/print'
// import Print from 'vue-print-nb'
// import Print from '@/util/print'
import 'moment/locale/zh-cn'
import ECharts from 'vue-echarts'
import 'echarts/lib/chart/line'
import 'echarts/lib/chart/pie'
import 'echarts/lib/chart/bar'
import 'echarts/lib/component/legend'
import 'echarts/lib/component/title'
import 'echarts/lib/component/tooltip'
import 'echarts/lib/component/toolbox'
import 'echarts/lib/component/markPoint'
import 'echarts/lib/component/markLine'
import 'echarts/lib/component/polar'
import horizontalScroll from 'el-table-horizontal-scroll'
import vuePhotoZoomPro from 'vue-photo-zoom-pro'
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
Vue.use(vuePhotoZoomPro)
Vue.use(horizontalScroll)
Vue.use(Viewer)
Viewer.setDefaults({
  Options: { "inline": true, "button": true, "navbar": true, "title": true, "toolbar": true, "tooltip": true, "movable": true, "zoomable": true, "rotatable": true, "scalable": true, "transition": true, "fullscreen": true, "keyboard": true, "url": "data-source" }
});
window.eventBus1 = new Vue()

moment.locale('zh-cn')
// 插件 json 展示
Vue.use(router)
Vue.use(Print)
Vue.use(tableDesign);
Vue.use(Antd)
Vue.use(tableHeight)
// Vue.use(AvueFormDesign);
window.axios = axios
window.dayjs = dayjs
Vue.use(VueAxios, axios)

Vue.use(ElementUI, {
  size: 'small',
  menuType: 'text'
})
Vue.use(AvueUeditor);
Vue.use(AVUE, {
  size: 'small',
  menuType: 'text'
})
Vue.component('v-chart', ECharts)
// 注册全局容器
Vue.component('basicContainer', basicContainer)

// 加载相关url地址
Object.keys(urls).forEach(key => {
  Vue.prototype[key] = urls[key]
})

// 加载过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

// 动态加载阿里云字体库
iconfontVersion.forEach(ele => {
  loadStyle(iconfontUrl.replace('$key', ele))
})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
